package edu.jd.block_chain.project.project.impl;

import edu.jd.block_chain.project.project.Project;
import edu.jd.block_chain.project.project.ProjectDto;
import edu.jd.block_chain.project.project.ProjectService;
import edu.jd.block_chain.project.project.dao.ProjectDao;
import edu.jd.block_chain.security.register.dao.RegisterDao;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional
public class ProjectImpl implements ProjectService {
    @Resource
    private ProjectDao projectDao;
    @Override
    public void addProject(ProjectDto projectDto) {
        projectDao.addProject(projectDto);

    }

    @Override
    public Project getProjectInfo(ProjectDto projectDto) {
        Project project= projectDao.getProjectInfo(projectDto);
        return project;
    }

    @Override
    public int countProject() {
        int a=projectDao.countProject();
        return a;
    }

    @Override
    public List<Project> getProjectList() {
        List<Project> project= projectDao.getProjectList();
        return project;
    }
}
